from rest_framework import serializers
from rest_framework.serializers import ModelSerializer

from goods.models import GoodsChannel, GoodsChannelGroup, SpecificationOption


class SpecificationOptionSerializer(ModelSerializer):
    #关联嵌套

    spec = serializers.StringRelatedField(read_only=True)
    spec_id = serializers.IntegerField()

    class Meta:
        model = SpecificationOption
        fields = '__all__'